//
//  TestViewController.m
//  CKApp
//
//  Created by CC on 2020/9/4.
//  Copyright © 2020 This Moment. All rights reserved.
//

#import "TestViewController.h"
#import "LcFoundation.h"
#import "AttributeStringCellData.h"
#import "SeparatorCellData.h"
#import "ApiRequestUtil.h"
#import "CCRequestData.h"
#import "CCResponseData.h"

@interface TestViewController ()
@property(nonatomic, weak) IBOutlet UITableView* tableView;
@property(nonatomic, strong) LcCellAdapter* cellAdapter;
@end

@implementation TestViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  self.cellAdapter = [[LcCellAdapter alloc] init];
  [self addCellAdapter:self.cellAdapter forTableView:self.tableView];
}

- (void)refreshAll {
  [self.cellAdapter removeAllCellDatas];

  AttributeStringCellData* stringCellData = [AttributeStringCellData cellDataWithAttributeString:nil onClickHandler:^(__kindof LcCellData *cellData) {

  }];
  [self.cellAdapter addCellData:stringCellData];

  [self.cellAdapter refreshAllCells];
}

- (void)requestData {
  CCRequestData* requestData = [[CCRequestData alloc] init];

  LcWeakSelf;
  [ApiRequestUtil sendRequest:requestData successHandler:^(__kindof CCRequestData *requestData, id responseData) {
    LcStrongSelf;
  } errorHandler:^(__kindof CCRequestData *requestData, LcApiError *apiError) {
    LcStrongSelf;
  } showModalLoadingIndicator:YES];


}

- (void)sendNotification {
  [[LcNotificationCenter sharedInstance] sendNotification:@"order"];
}

- (void)notificationReceived:(NSString *)notification auxiliary:(id)auxiliary {
  [super notificationReceived:notification auxiliary:auxiliary];
  if ([notification isEqualToString:@"login"]) {

  }
}

@end
